package com.niiwoo.civet.trade.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 标的来源枚举
 */
@AllArgsConstructor
@Getter
public enum ProjectFromSourceEnum {
    APP((byte)1, "APP",ProjectTianChengFromSourceEnum.APP),
    H5_ACTIVITY((byte)2, "H5活动",ProjectTianChengFromSourceEnum.H5_ACTIVITY),
    H5_SPEED_LOAN((byte)3, "H5极速借",ProjectTianChengFromSourceEnum.H5_SPEED_LOAN),
    R360((byte)4, "融360",ProjectTianChengFromSourceEnum.R360),
    CARD_NIU((byte)5, "卡牛", ProjectTianChengFromSourceEnum.CARD_NIU),
    ORG_SPEEDLOAN_NEW((byte)6, "极速借机构", null),
    TUBATU((byte)7, "土巴兔", null),
    HUIJIE((byte)8, "汇介", null);

    private Byte type;
    private String desc;
    private ProjectTianChengFromSourceEnum tianChengFromSourceEnum;
    
    public static ProjectFromSourceEnum enumOf(Byte code) {
        for (ProjectFromSourceEnum fromSource : values()) {
            if (fromSource.type == code.byteValue()) {
                return fromSource;
            }
        }
        return null;
    }
}
